<?

class DuelModel extends AGModel
{

  function __construct($modelName) 
  {
    parent::__construct($modelName);
    // your constructor code goes here
    
  }
  
  function getDuelPartners()
  {
    $diff = floor($this->character->level / 3.5);
    if ($diff < 1) $diff = 1;
    $minLevel = $this->character->level-$diff;
    $maxLevel = $this->character->level+$diff;
    return(DB_GetList('SELECT c_key,c_name,c_level,u_fb_pic_square,z_name,z_key FROM '.getTableName('characters').'
      LEFT JOIN '.getTableName('users').' ON (u_key=c_ref_user)
      LEFT JOIN '.getTableName('zones').' ON (z_key=c_location)
      WHERE c_level >= '.$minLevel.' AND c_level <= '.$maxLevel.'
      AND c_ref_user > 0 AND c_key != '.$this->character->charDS['c_key'].'
      ORDER BY rand()
      LIMIT 10'));
  }

}


?>
